import tiktoken

def count_tokens(text: str, model: str = "gpt-3.5-turbo") -> int:
    """
    Calculate the number of tokens in a text string using tiktoken.
    
    Args:
        text: The input text string
        model: The model name to use for tokenization (default: gpt-3.5-turbo)
        
    Returns:
        Number of tokens in the text
    """
    encoding = tiktoken.encoding_for_model(model)
    return len(encoding.encode(text))
